import { defineStore } from 'pinia'

export const useCounterStore = defineStore({
  id: 'counter',
  //数据持久化
  persist: {
    enabled: true
  },
  state: () => ({
    arrListt: [],
    historyArr: [],
    res: {},
    aaa: true,
    tabbarActive: ''
  }),
  actions: {
    add(obj) {
      this.arrListt = obj
    },
    addHistory(value) {
      this.historyArr.unshift(value)
    },
    addToken(val) {
      this.res = val
    },
    shou(val) {
      this.aaa = val
    },
    del() {
      this.res = {}
    },
    delm() {
      this.historyArr = []
    },
    tabChange(i) {
      this.tabbarActive = i
    }
  },
  getters: {}
})
